//
//  JNetManager.h
//  HeadIndustry
//
//  Created by jun on 2017/8/28.
//  Copyright © 2017年 jun. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, RequestMethodType) {
    RequestMethodTypePost = 1,
    RequestMethodTypeGet  = 2
};

@interface JNetManager : NSObject

#define  login_Regist
/// 发送验证码
+ (void)sendCodeToTelURL:(NSString *)url
                     tel:(NSString *)tel
                 success:(void (^)(id response))success
                 failure:(void (^)(NSString *err))failure;

/// 注册
+ (void)registRequestURL:(NSString *)url
               parperDic:(NSDictionary *)dic
                 success:(void (^)(id response))success
                 failure:(void (^)(NSString *err))failure;

/// 登陆
+ (void)loginRequestURL:(NSString *)url
              parperDic:(NSDictionary *)dic
                success:(void (^)(id response))success
                failure:(void (^)(NSString *err))failure;

/// 找回密码
+ (void)fendPswRequestURL:(NSString *)url
                parperDic:(NSDictionary *)dic
                  success:(void (^)(id response))success
                  failure:(void (^)(NSString *err))failure;

/// 秒杀图加载
+ (void)LoadKillProductImgUrl:(NSString *)url
                 success:(void (^)(id response))success
                 failure:(void (^)(NSString *err))failure;

/// 广告图加载
+ (void)LoadAdviceImgUrl:(NSString *)url
                 success:(void (^)(id response))success
                 failure:(void (^)(NSString *err))failure;

/// 分类图加载
+ (void)LoadKindAdviceImgUrl:(NSString *)url
                     success:(void (^)(id response))success
                     failure:(void (^)(NSString *err))failure;

/// 商品列表加载
+ (void)LoadProductListUrl:(NSString *)url
                 pageModel:(JGetPageModel *)pageModel
                   success:(void (^)(id response))success
                   failure:(void (^)(NSString *err))failure;

#define mark - product detail

/// 当前商品详情加载
+ (void)LoadProductDetailUrl:(NSString *)url
                   pageModel:(JCurrentProductModel *)pageModel
                     success:(void (^)(id response))success
                     failure:(void (^)(NSString *err))failure;
/// 当前商品评论加载
+ (void)LoadProductCommentUrl:(NSString *)url
               productIDModel:(JReuqestProductDetailModel *)productIDModel
                      success:(void (^)(id response))success
                      failure:(void (^)(NSString *err))failure;

/// 猜你喜欢加载
+ (void)LoadYouLikeCommentUrl:(NSString *)url
               productIDModel:(JYouLikeModel *)productIDModel
                      success:(void (^)(id response))success
                      failure:(void (^)(NSString *err))failure;
/// 加入收藏
+ (void)AddCommentToCollectUrl:(NSString *)url
                productIDModel:(JCurrentProductModel *)productIDModel
                       success:(void (^)(id response))success
                       failure:(void (^)(NSString *err))failure;

/// 搜索
+ (void)SearchProductRequestUrl:(NSString *)url
                           dic :(NSDictionary *)dic
                       success:(void (^)(id response))success
                       failure:(void (^)(NSString *err))failure;

#define mark - product second request

//Categories/GetCategoriesByParentId
/// 商品类型二级页面 list
+ (void)getProductSecondRequestUrl:(NSString *)url
                  productTypeModel:(JProductTypeModel *)typeModel
                           success:(void (^)(id response))success
                           failure:(void (^)(NSString *err))failure;
//Products/GetProducts
/// 商品类型二级页面 Product
+ (void)getProductListRequestUrl:(NSString *)url
                  productListDic:(NSDictionary *)productListDic
                         success:(void (^)(id response))success
                         failure:(void (^)(NSString *err))failure;


#define mark - shopCar request
/// 请求产品属性 ，加入购物车
+ (void)GetProductAttributeUrl:(NSString *)url
                productIDModel:(JCurrentProductModel *)productIDModel
                       success:(void (^)(id response))success
                       failure:(void (^)(NSString *err))failure;

/// 商品添加购物车，或购买
+ (void)GetProductAttributeUrl:(NSString *)url
               buyProductModel:(JAddToShopCarRequestModel *)buyProductModel
                       success:(void (^)(id response))success
                       failure:(void (^)(NSString *err))failure;
/// 获取购物车列表
+ (void)GetShopCarProductListUrl:(NSString *)url
                      productIDs:(NSString *)productIDs
                          userID:(JUserInfoModel *)userInfo
                         success:(void (^)(id response))success
                         failure:(void (^)(NSString *err))failure;

//ShoppingCartItems/UpdateShoppingCartItems
/// 更改购物车商品数量
+ (void)UpdateShopCarProductListUrl:(NSString *)url
                         productArr:(NSArray *)productMArr
                            success:(void (^)(id response))success
                            failure:(void (^)(NSString *err))failure;

//ShoppingCartItems/DeleteShoppingCartItem
///  购物车   删除商品
+ (void)DelectShopCarProductUrl:(NSString *)url
                      productID:(NSInteger)productID
                        success:(void (^)(id response))success
                        failure:(void (^)(NSString *err))failure;

#define mark - AddressRequest

//Address/GetAddress
///  用户地址
+ (void)CustomerAddressRequestUrl:(NSString *)url
                       CustumerID:(NSInteger)CustumerID
                          success:(void (^)(id response))success
                          failure:(void (^)(NSString *err))failure;


//Address/GetAddressForCustomer
///  获取用户收货地址列表
+ (void)getCustomerAddressListRequestUrl:(NSString *)url
                                 success:(void (^)(id response))success
                                 failure:(void (^)(NSString *err))failure;


//Address/GetAreaJsonData
///  获取省市区 详情
+ (void)AddressCityInfoRequestUrl:(NSString *)url
                          success:(void (^)(id response))success
                          failure:(void (^)(NSString *err))failure;

//Address/CreateAddress
///  添加收货地址
+ (void)AddCustomerAddressRequestUrl:(NSString *)url
                     addAddressModel:(JAddressAddModel *)addAddressModel
                             success:(void (^)(id response))success
                             failure:(void (^)(NSString *err))failure;

////Address/CreateAddress
/////  编辑收货地址
//+ (void)editCustomerAddressRequestUrl:(NSString *)url
//                      addAddressModel:(JAddressAddModel *)addAddressModel
//                              success:(void (^)(id response))success
//                              failure:(void (^)(NSString *err))failure;


//Address/SetDefaultAddress
///  更新默认收货地址
+ (void)SetDefaultAddressRequestUrl:(NSString *)url
                        AddressModel:(JAddressModel *)AddressModel
                             success:(void (^)(id response))success
                             failure:(void (^)(NSString *err))failure;

//Address/DeleteAddress
///  删除收货地址
+ (void)DeleteAddressRequestUrl:(NSString *)url
                   AddressModel:(JAddressModel *)AddressModel
                        success:(void (^)(id response))success
                        failure:(void (^)(NSString *err))failure;

//Address/GetAddress
///  支付页面默认地址
+ (void)getAddressRequestUrl:(NSString *)url
                  CustumerID:(NSInteger)CustumerID
                     success:(void (^)(id response))success
                     failure:(void (^)(NSString *err))failure;

#define mark - orderRequest

//Orders/GetOrdersCount
///  获取用户账单信息
+ (void)getUserOrderInfoRequestUrl:(NSString *)url
                        CustumerID:(NSInteger)CustumerID
                           success:(void (^)(id response))success
                           failure:(void (^)(NSString *err))failure;


//Orders/GetOrdersByCustomerId
///  获取用户待付款账单信息
+ (void)getUserWaitPayOrderInfoUrl:(NSString *)url
                            typeID:(NSInteger)type
                           success:(void (^)(id response))success
                           failure:(void (^)(NSString *err))failure;


//ServerOrder/GetServerOrders
///  获取用户待付款账单信息（团购）
+ (void)getGroupUserWaitPayOrderInfoUrl:(NSString *)url
                                 typeID:(NSInteger)type
                                success:(void (^)(id response))success
                                failure:(void (^)(NSString *err))failure;

//Orders/CancelOrder
///  取消订单
+ (void)cancelOrderRequedtUrl:(NSString *)url
                waitPatModel:( id )paymodel
                     success:(void (^)(id response))success
                     failure:(void (^)(NSString *err))failure;

// Orders/ReturnOrderItem 待发货状态时的接口
// Orders/CreateReturnOrder 待收货状态时的接口
///  退货
+ (void)ReturnOrderRequedtUrl:(NSString *)url
                 waitPatModel:(NSDictionary  *)dic
                      success:(void (^)(id response))success
                      failure:(void (^)(NSString *err))failure;

#define mark - user Request

// WeChart / GetOpenId
///  获取用户微信信息
+ (void)getUserWXInfoRequestUrl:(NSString *)url
                   code:(NSString *)code
                      success:(void (^)(id response))success
                      failure:(void (^)(NSString *err))failure;

//Customers/GetCustomerById
///  获取用户信息
+ (void)getUserInfoRequestUrl:(NSString *)url
                   CustumerID:(NSInteger)CustumerID
                      success:(void (^)(id response))success
                      failure:(void (^)(NSString *err))failure;

//Customers/UpdateCustomer
///  更新用户信息
+ (void)UpdateCustomerInfoRequedtUrl:(NSString *)url
                         userInfoObj:(JUserInfoModel *)userInfoObj
                             success:(void (^)(id response))success
                             failure:(void (^)(NSString *err))failure;

//BusinessSettled/SendMobileMsg
///  商家入驻
+ (void)BusinessSettledRequedtUrl:(NSString *)url
                          success:(void (^)(id response))success
                          failure:(void (^)(NSString *err))failure;

//FeadBack/InsertFeadback
///  意见反馈
+ (void)FeedBackRequedtUrl:(NSString *)url
                   Content:(NSDictionary *)ContentDic
                    success:(void (^)(id response))success
                    failure:(void (^)(NSString *err))failure;

#define mark - collect Request

//Products/GetFavoriteProducts
///  收藏商品
+ (void)getCollectProductRequedtUrl:(NSString *)url
                          success:(void (^)(id response))success
                          failure:(void (^)(NSString *err))failure;

//Vendor/GetCollectVendors
///  收藏店铺列表
+ (void)getCollectShopRequedtUrl:(NSString *)url
                            success:(void (^)(id response))success
                            failure:(void (^)(NSString *err))failure;

#define mark - Comment
//Products/ProductComment
///  发布评论
+ (void)submitProductCommentRequedtUrl:(NSString *)url
                         parpemDic:(NSDictionary *)parpemDic
                               success:(void (^)(id response))success
                               failure:(void (^)(NSString *err))failure;

#define mark - Vendor
//Vendor/GetVendorById
///  店铺详情
+ (void)getGetVendorByIdRequedtUrl:(NSString *)url
                          verdorId:(NSInteger )verdorId
                          success:(void (^)(id response))success
                          failure:(void (^)(NSString *err))failure;
//Vendor/CollectVendor
///  店铺收藏 功能
+ (void)getCollectVendorRequedtUrl:(NSString *)url
                          verdorId:(NSInteger )verdorId
                           success:(void (^)(id response))success
                           failure:(void (^)(NSString *err))failure;

//Categories/GetCategoriesByVendorId
/// 店铺获取商品分类
+ (void)GetCategoriesByVendorIdRequedtUrl:(NSString *)url
                          verdorId:(NSInteger )verdorId
                           success:(void (^)(id response))success
                           failure:(void (^)(NSString *err))failure;

//Products/GetProducts
/// 店铺获取商品
+ (void)GetVerdorProductsRequedtUrl:(NSString *)url
                           verdorId:(NSInteger )verdorId
                          pagemodel:(JGetPageModel *)pagemodel
                            success:(void (^)(id response))success
                            failure:(void (^)(NSString *err))failure;


#define mark - cuthair request
//BarberSh/GetSearchBarberShop
/// 理发店商品请求
+ (void)GetCutHairShopProductsRequedtUrl:(NSString *)url
                        parameModel:(JCutHairRequestModel *)parameModel
                            success:(void (^)(id response))success
                            failure:(void (^)(NSString *err))failure;

//BarberSh/GetAreasByCity
/// 理发店地区请求
+ (void)GetCutHairShopCityRequedtUrl:(NSString *)url
                        shopNameTip:(NSString *)shopNameTip
                            success:(void (^)(id response))success
                            failure:(void (^)(NSString *err))failure;

//Orders/GetMsgsCount
/// 理发店信息请求
+ (void)GetCutHairShopMsgsCountRequedtUrl:(NSString *)url
                             success:(void (^)(id response))success
                             failure:(void (^)(NSString *err))failure;

#define mark - beautiful
//Cirle/AddSocialHub
/// 创建圈聊
+ (void)subBeautifulSocialHubRequedtUrl:(NSString *)url
                                 dicPar:(NSDictionary *)dic
                                success:(void (^)(id response))success
                                failure:(void (^)(NSString *err))failure;


//Cirle/GetSocialHubNotes
/// 网聊协议
+ (void)GetGetSocialHubNotesRequedtUrl:(NSString *)url
                                  success:(void (^)(id response))success
                                  failure:(void (^)(NSString *err))failure;

////TimeShow/AddTimeShow
///// 创建日记
//+ (void)subBeautifulAddTimeShowRequedtUrl:(NSString *)url
//                                 dicPar:(NSDictionary *)dic
//                                success:(void (^)(id response))success
//                                failure:(void (^)(NSString *err))failure;
//
////ActivityMine/AddActivity
///// 创建活动
//+ (void)subBeautifulAddActivityRequedtUrl:(NSString *)url
//                                 dicPar:(NSDictionary *)dic
//                                success:(void (^)(id response))success
//                                failure:(void (^)(NSString *err))failure;
#define mark - HTML

//#define token_Id @"token=otsdIwSGynDcz2dyiBSR5hBzwJJg&customerId=780"
//#define token_Id @"token=ol3BK0cYvOVRIV7ATctOur9Y6uMI&customerId=9616"
#define HTML_URL_STR(urlstr)   [NSString stringWithFormat:@"%@?&%@",urlstr,[GLOBALDATA token_Id]]
// 个人主页
#define prosonageHTML_URL_STR   HTML_URL_STR(@"http://www.touhanggo.com/Mobile/MyInfo/Index")
//@"http://www.touhanggo.com/Mobile/MyInfo/Index?&token=otsdIwSGynDcz2dyiBSR5hBzwJJg&customerId=780"


// 消息
#define msg_HTML_URL_STR HTML_URL_STR(@"http://www.touhanggo.com/Mobile/IM/Index")

// 理发店
#define CutHair_HTML_URL @"http://www.touhanggo.com/Mobile/BarberShops/BarberShopsDetail"

#define CutHair_HTML_URL_STR(urlstr,numID,token_Id)   [NSString stringWithFormat:@"%@/%ld?&%@",urlstr,numID,token_Id]

//http://www.touhanggo.com/Mobile/IM/PrivateChat?ContactorId=15475&UserId=10004&imToken=null
// 联系商家
#define contact_URL_STR  @"http://www.touhanggo.com/Mobile/IM/PrivateChat"
#define contact_HTML_URL_STR(urlstr,ConId,UsId,token_Id)   [NSString stringWithFormat:@"%@?ContactorId=%@&UserId=%@&imToken=@""&%@",urlstr,ConId,UsId,token_Id]
// 美丽圈
#define Beautiful_HTML_URL_STR   HTML_URL_STR(@"http://www.touhanggo.com/Mobile/TimeShow")
// 创建圈子
#define BuildCircle @"http://www.touhanggo.com/Mobile/BeautifulCirle/BuildCircle"
// 创建活动
#define ActivityBuild @"http://www.touhanggo.com/Mobile/Activitys/ActivityBuild"
// 日记
#define WriteDiary @"http://www.touhanggo.com/Mobile/TimeShow/WriteDiary"


// 全部评论
#define AllComment_URL @"http://www.touhanggo.com/Mobile/Product/CommentList"

#define AllComment_HTML_URL_STR(urlstr,numID,token_Id)   [NSString stringWithFormat:@"%@?&proId=%ld&%@",urlstr,numID,token_Id]

// 关于我们
#define About_URL @"http://www.touhanggo.com/Mobile/PersonCenter/About"
#define About_HTML_URL_STR(urlstr,token_Id)   [NSString stringWithFormat:@"%@?&%@",urlstr,token_Id]

// 查看物流
//http://www.touhanggo.com/Mobile/Order/LogisticsTracking?tradeNo=02152255555665&orderId=88
#define lookGoods_URL @"http://www.touhanggo.com/Mobile/Order/LogisticsTracking"
#define lookGoods_HTML_URL_STR(urlstr,token_Id)   [NSString stringWithFormat:@"%@?&%@",urlstr,token_Id]

// 团购详情
#define GoodsDetail_URL @"http://www.touhanggo.com/Mobile/BarberShops/BarberShopsPurchasedList"
#define GoodsDetail_HTML_URL_STR(urlstr,numID,token_Id)   [NSString stringWithFormat:@"%@/%ld?&%@",urlstr,numID,token_Id]

// http://www.touhanggo.com/Mobile/BarberShops/BarberShopsPurchasedList/36?token=ol3BK0cYvOVRIV7ATctOur9Y6uMI&customerId=9616

@end
